package com.szcinda.fitness.persistence;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Data
@Entity
public class BodyMeasurement extends BaseEntity {
    private String name;
    private String unit;
    private double value;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "train_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private DailyTrain dailyTrain;
}
